package com.inspur.his.service.impl;

import com.inspur.his.mapper.UserMapper;
import com.inspur.his.pojo.User;
import com.inspur.his.pojo.UserExt;
import com.inspur.his.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User getUserByNameAndPass(HashMap map) {
        return userMapper.getUserByNameAndPass(map);
    }

    public void updatePwd(HashMap map){
        userMapper.updatePwd(map);
    }
    public List<User> userList(HashMap map){
        return  userMapper.userList(map);
    }
    public void userAdd(User user){
        userMapper.userAdd(user);
    }
    @Override
    public User getUserById(String id) {
        return userMapper.getUserById(id);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }
    public List<User> getUserByName(String username){
        return userMapper.getUserByName(username);
    }
    public void changeStatus(HashMap map){
        userMapper.changeStatus(map);
    }

    public List<UserExt> getUserByRole(){
        return userMapper.getUserByRole();
    }
}